#include "dialog.h"
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>

Dialog::Dialog(QWidget*parent):QDialog(parent)
{
    QPushButton* pushButton = new QPushButton("按钮",this);
    QLabel* label = new QLabel("label",this);
    QVBoxLayout* lay = new QVBoxLayout();
    this->setLayout(lay);
    lay->addWidget(pushButton);
    lay->addWidget(label);

    connect(pushButton,&QPushButton::clicked,this,&Dialog::handel);
}

void Dialog::handel()
{
    this->close();
}
